package behavior.visitor;

import behavior.visitor.impl.Charger;
import behavior.visitor.impl.ChineseMedicine;
import behavior.visitor.impl.Pharmacy;
import behavior.visitor.impl.WesternMedicine;

public class VisitorTest {
	public static void main(String[] args) {
		Medicine a = new ChineseMedicine("板蓝根", 11.0);
		Medicine b = new WesternMedicine("感康", 14.3);

		Presciption presciption = new Presciption();
		presciption.addMedicine(a);
		presciption.addMedicine(b);

		Visitor charger = new Charger();
		charger.setName("张三");

		Visitor pharmacy = new Pharmacy();
		pharmacy.setName("李四");

		presciption.accept(charger);
		System.out.println("-------------------------------------");
		presciption.accept(pharmacy);
	}
}
